<?php
	include "auth.php";
	include "../includes/header.php"; 

?>

<div id="select_page" data-role="page">
	<div data-role="content">
		<?php echo "<h3>Hallo, ". $_SESSION['username']  . " Ihr letzter Login war am: ". $_SESSION['lastLogin'] ."</h3>"; ?>
		<p>
			Wähle einen Ort für deine Städte Tour aus:
		</p>
		<form action="select.php" method="post" >
			<div data-role="fieldcontain">
				<label for="select-choice-0" class="select">Land:</label>
				<select name="select-choice-0" id="select-choice-0" onChange="form.submit()">		
					<?php include "country.php"; getCountry(); ?>
				</select>			
			</div>
			<?php		
				if($_SESSION['isCountry'] == 1){
			?>		
			<div data-role="fieldcontain">
				<label for="select-choice-1" class="select">Stadt:</label>
				<select name="select-choice-1" id="select-choice-1" onChange="form.submit()">		
					<?php include "city.php"; getCityFromCurrentCountry(); ?>				
				</select>
			</div>
			<?php
				}
				if($_SESSION['isCity'] == 1){
			?>
		</form>	
		<form action="list.php" method="post" accept-charset="UTF-8">		
				
			<button id="townSend" type="submit" name="submit" value="submit" data-theme="c">Route auswählen</button>
		</form>
		<?php
		}
		?>
		
	</div>
	<div data-role="footer" class="nav-glyphish-example" data-fullscreen="true" data-position="fixed">
		<div data-role="navbar" class="nav-glyphish-example" data-grid="solo">
		<ul>
			<li><a href="logout.php" id="map_nav_login" data-icon="custom">Logout</a></li>
		</ul>
		</div>
	</div>
</div>
<?php
	include "../includes/footer.php";
?>
